package com.xdhl.fu.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdhl.fu.order.domain.OrderInfo;
import com.xdhl.fu.order.domain.vo.OrderInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 订单信息
 * Mapper接口
 *
 * @author 朱力维
 * @time 2022/5/29 17:01
 */
@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {

    /**
     * 统计前16实时热门城市
     *
     * @return 统计前16实时热门城市
     */
    @Select("select\n" +
            "oi.destination,\n" +
            "count( oi.destination ) as count \n" +
            "from\n" +
            "order_info oi \n" +
            "group by\n" +
            "oi.destination \n" +
            "order by\n" +
            "count desc \n" +
            "limit 16")
    List<OrderInfoVO> countHotCityTop16();

}
